<?php

class FormValidator extends AbstractValidator {

    public function validate() {
        $BoIsValidForm = true;
        foreach($this->ArFields as $Field) {
            if( $this->isField($Field) && $Field->isNotValid() ) {
                $this->ArErrors = array_merge( $this->ArErrors, $Field->getFieldErrors() );
                $BoIsValidForm = false;
            }
        }
        return $BoIsValidForm;
    }

    private function isField($MxField) {
        return $MxField instanceof Field;
    }

}

?>
